// components/tab/tab.js
Component({
  properties: {
    tab:{
      type:Array,
      value:[]
    },
  },
  data: {},
  methods: {
    tabClick(e){
      const {index} = e.currentTarget.dataset;
      this.triggerEvent("tabClick",{index});
      this.data.tab.forEach((item,i)=> {
        item.isactive = false;
        if (index === i) {
          item.isactive = true;
        }
        this.setData({tab:this.data.tab})
      });
    }
  }
})
